import { getFileName } from '@utils/download'
export function blobData(response) {
  const { data = {}, headers } = response || {};
  const { type='' } = data;

  const blob = new Blob([data], { type: type })
  const url = window.URL.createObjectURL(blob);
  return {
    type,
    url,
    name: getFileName(headers)
  }
}